<template>
	<view class="container">
		<view class="content" v-if="detail.areaDetails">
			<mp-html :content="dealHtml(detail.areaDetails)" />
		</view>
	</view>
</template>

<script lang="ts" setup>
import {ref} from 'vue'
import api from '@/api'
import { dealHtml } from '@/hooks/useFunction'
import { onLoad,onHide,onShow} from '@dcloudio/uni-app'
onLoad((e)=>{
	score.value = e.score?e.score:4
	
})
onShow(()=>{
	homePageConfigList()
})
onHide(()=>{
	detail.value.areaDetails = ''
})
const score = ref(0)
const detail = ref({areaDetails:''})
//获取工作室配置
const homePageConfigList = async ()=>{
	const res: any = await api({
		method: 'get',
		url: `/mall/content/home-page-config/list`,
	})
	let arr = res.data.filter(item=>item.type==score.value)
	detail.value = arr[0]
}
</script>

<style lang="scss" scoped>
.container{
	width: 100vw;
	height: 100vh;
	padding: 32rpx;
	box-sizing: border-box;
	background-color: #F9F6F6;
	.content{
		width: 100%;
		height: 100%;
		padding: 32rpx;
		background-color: #fff;
		box-sizing: border-box;
	}
}
</style>
